// Room 1
function renderRoom1() {
	// Draw background
	fillRect(0, 0, 250, 600, { fill: '#222' })
	fillRect(450, 0, 350, 600, { fill: '#222' })
	fillRect(0, 0, 800, 200, { fill: '#222' })
	fillRect(0, 500, 800, 100, { fill: '#222' })

	// Draw wall lines
	strokeLine(0, 0, 150, 100, { lineWidth: 10 })
	strokeLine(0, 600, 150, 500, { lineWidth: 10 })
	strokeLine(150, 100, 150, 500, { lineWidth: 10 })
	strokeLine(150, 100, 800, 100, { lineWidth: 10 })
	strokeLine(150, 500, 800, 500, { lineWidth: 10 })

	// Draw door lines
	strokeRect(250, 200, 200, 300, { lineWidth: 10 })
}
function renderRoom1DeskAndMonitor() {
	// Draw desk
	fillRect(500, 450, 400, 150, { fill: '#200' })
	strokeRect(500, 450, 400, 150, { lineWidth: 10 })

	// Draw monitor
	fillRect(550, 350, 150, 100, { fill: '#000' })
	strokeRect(550, 350, 150, 100, { lineWidth: 10 })
}
// Room 2
function renderRoom2() {
	// Draw background
	fillRect(0, 0, 350, 600, { fill: '#222' })
	fillRect(550, 0, 250, 600, { fill: '#222' })
	fillRect(0, 0, 800, 200, { fill: '#222' })
	fillRect(0, 500, 800, 100, { fill: '#222' })

	// Draw wall lines
	strokeLine(800, 0, 650, 100, { lineWidth: 10 })
	strokeLine(800, 600, 650, 500, { lineWidth: 10 })
	strokeLine(650, 100, 650, 500, { lineWidth: 10 })
	strokeLine(650, 100, 0, 100, { lineWidth: 10 })
	strokeLine(650, 500, 0, 500, { lineWidth: 10 })

	// Draw door lines
	strokeRect(350, 200, 200, 300, { lineWidth: 10 })
}
function renderRoom2DeskAndMonitor() {
	// Draw desk
	fillRect(-100, 450, 400, 150, { fill: '#200' })
	strokeRect(-100, 450, 400, 150, { lineWidth: 10 })
}
// Room 5
function renderRoom5() {
	// Draw corner border
	strokeLine(400, 75, 400, 400, { lineWidth: 10 })
	strokeLine(200, 525, 400, 400, { lineWidth: 10 })
	strokeLine(600, 525, 400, 400, { lineWidth: 10 })
}
// Room 6
function renderRoom6() {
	// Draw corner border
	strokeRect(200, 180, 400, 240, { lineWidth: 10 })
	strokeRect(200, 180, 400, 240, { fill: '#AAA' })
	fillText('CONTROL PANEL', 400, 210, { fontSize: 40 })
	for (let i = 0; i < 5; ++i) {
		for (let j = 0; j < 9; ++j) {
			let sx = 390 + 35 * (j - 4)
			let sy = 240 + 30 * i
			fillRect(sx, sy, 20, 20, { fill: (i < 2) ? '#040' : ((i < 4) ? '#660' : '#800') })
			strokeRect(sx, sy, 20, 20, { lineWidth: 5 })
		}
	}
}
// Room 7
function renderRoom7() {
	// Draw main hall border
	strokeRect(200, 150, 400, 300, { lineWidth: 10 })
	strokeLine(200, 150, 100, 150, { lineWidth: 10 })
	strokeLine(200, 450, 100, 450, { lineWidth: 10 })
	strokeLine(600, 150, 700, 150, { lineWidth: 10 })
	strokeLine(600, 450, 700, 450, { lineWidth: 10 })

	strokeLine(100, 75, 200, 150, { lineWidth: 10 })
	strokeLine(100, 525, 200, 450, { lineWidth: 10 })
	strokeLine(700, 75, 600, 150, { lineWidth: 10 })
	strokeLine(700, 525, 600, 450, { lineWidth: 10 })

	// Draw entrance
	strokeLine(400, 150, 400, 450, { lineWidth: 10 })
	strokeLine(400, 200, 600, 150, { lineWidth: 10 })
	strokeLine(400, 400, 600, 450, { lineWidth: 10 })
	fillText('←', 520, 300, { fill: '#FFF', fontSize: 100 })

	// Draw noticeboard chain
	strokeLine(180, 75, 180, 150, { lineWidth: 10 })
	strokeLine(420, 75, 420, 150, { lineWidth: 10 })

	// Draw noticeboard
	fillRect(140, 100, 320, 210, { fill: '#444' })
	strokeRect(140, 100, 320, 210, { lineWidth: 10 })
	fillText('YaYaYa\'s Marble Race', 300, 120, { fill: '#FFF', fontSize: 30 })
	drawImage('assets/background/racelogo.png', 250, 135, 80, 80)
	fillText('↑ Auditorium entrance', 300, 230, { fill: '#FFF', fontSize: 30 })
	fillText('→ Ticket office', 300, 260, { fill: '#FFF', fontSize: 30 })
	fillText('↓ ???', 300, 290, { fill: '#FFF', fontSize: 30 })
}
// Room 8
function renderRoom8() {
	// Draw noticeboard
	strokeLine(300, 300, 300, 500, { lineWidth: 10 })
	fillRect(200, 200, 200, 100, { fill: '#FFF' })
	fillText('TICKETS', 300, 250, { fill: '#000', fontSize: 50 })
	strokeRect(200, 200, 200, 100, { lineWidth: 10 })

	// Draw desk
	fillRect(100, 425, 600, 100, { fill: '#200' })
	strokeRect(100, 425, 600, 100, { lineWidth: 10 })
}
// Room 9 is unavailable
// Room 10
function renderRoom10() {
	// Draw seats
	for (let j = 0; j < 9; ++j) {
		for (let i = 0; i < 9; ++i) {
			let sx = 120 + 60 * i + 5 * j
			let sy = 100 + 30 * j
			strokeRect(sx, sy, 25, 100, { lineWidth: 20 })
			strokeRect(sx, sy + 100, 50, 50, { lineWidth: 20 })
			fillRect(sx, sy, 25, 100, { fill: '#200' })
			fillRect(sx, sy + 100, 50, 50, { fill: '#200' })
		}
	}
}
// Room 11
function renderRoom11() {
	// Draw seats
	for (let j = 0; j < 4; ++j) {
		for (let i = 0; i < 4; ++i) {
			let sx = 120 + 120 * i + 20 * j
			let sy = 80 + 90 * j
			strokeRect(sx, sy, 50, 100, { lineWidth: 20 })
			strokeRect(sx, sy + 100, 100, 50, { lineWidth: 20 })
			fillRect(sx, sy, 50, 100, { fill: '#200' })
			fillRect(sx, sy + 100, 100, 50, { fill: '#200' })
		}
	}
}
// Room 12
function renderRoom12() {
	// Draw race area
	drawImage('assets/background/race.jpg', 200, 150, 400, 300)

	// Draw race area border
	strokeRect(200, 150, 400, 300, { lineWidth: 10 })
	strokeLine(100, 75, 200, 150, { lineWidth: 10 })
	strokeLine(100, 525, 200, 450, { lineWidth: 10 })
	strokeLine(700, 75, 600, 150, { lineWidth: 10 })
	strokeLine(700, 525, 600, 450, { lineWidth: 10 })
}
// Room 13
function renderRoom13() {
	// Draw seats
	for (let j = 0; j < 3; ++j) {
		for (let i = 0; i < 4; ++i) {
			let sx = 250 + 120 * i - 20 * j
			let sy = 125 + 90 * j
			strokeRect(sx, sy, 50, 100, { lineWidth: 20 })
			strokeRect(sx - 50, sy + 100, 100, 50, { lineWidth: 20 })
			fillRect(sx, sy, 50, 100, { fill: '#200' })
			fillRect(sx - 50, sy + 100, 100, 50, { fill: '#200' })
		}
	}
}